" vundle plugin manager, this is must be the top of .vimrc
set nocompatible
filetype off
" add runtime path
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'jiangmiao/auto-pairs'
Plugin 'TagHighlight'
Plugin 'derekwyatt/vim-fswitch'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'vim-syntastic/syntastic'
Plugin 'posva/vim-vue'
call vundle#end()
filetype plugin indent on
" vundle plugin manager

set number
" set relativenumber
set history=1024

set undodir=~/.vim/undo_dirs
set backup             " keep a backup file (restore to previous version)
" set backupext=.bak
" set patchmode=.orig
set undofile           " keep an undo file (undo changes after closing)
set noswapfile         " not keep swap file
set ruler              " show the cursor position all the time
set cursorline

set showcmd            " display incomplete commands

set hlsearch
set incsearch

set go=             

set showmatch
set matchtime=5  
set nospell

set mouse=a
set nrformats=
set vb t_vb=
set modifiable
syntax on
filetype plugin indent on

set nolist

set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,utf-16,ucs-bom,gbk,shift-jis,gb18030,gb2312,cp936,latin1
set termencoding=utf-8

set langmenu=zh_CN.UTF-8
set helplang=cn

set guifont=MS_Gothic:h12:b:cDEFAULT

colo desert
set clipboard+=unnamed

set foldmethod=indent
set foldlevel=100
set autoindent
set smartindent

" replace tab with space  
set expandtab  
" 设定 tab 长度为 4  
set tabstop=4  
" 设置按BackSpace的时候可以一次删除掉4个空格  
set softtabstop=4  
" 设定 << 和 >> 命令移动时的宽度为 4  
set shiftwidth=4  
set smarttab  

"ctags set
set tags=ctags
set tags+=~/.vim/tags/opencv_py.tags
set tags+=~/.vim/tags/opencv.tags
set tags+=~/.vim/tags/opencv_contrib.tags
set autochdir 


" 映射全选+复制 ctrl+a
map <C-A> ggVGY
map! <C-A> <Esc>ggVGY
map <F12> gg=G
" 选中状态下 Ctrl+c 复制
vmap <C-c> "+y

set autoread
set autowrite


 " 上下可视行数  
" set scrolloff=6  
"

set nocompatible
filetype plugin on
runtime macros/matchit.vim

" taglist
let Tlist_Ctags_Cmd='/usr/bin/ctags'
let Tlist_Auto_Open=1
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_Right_Window=1

" nerdtree
let NERDTreeMapOpenInTab='t'
" tab switch
nnoremap th  :tabfirst<CR>
nnoremap tk  :tabnext<CR>
nnoremap tj  :tabprev<CR>
nnoremap tl  :tablast<CR>

" *.cpp 和 *.h 间切换
nnoremap sw :FSHere<CR>

" syntastic
let g:syntastic_python_checkers=['flake8'] " 使用pyflakes, 速度比pylint快
let g:syntastic_python_flake8_post_args="--max-line-length=120"  " 使用pyflakes, 速度比pylint快
let g:syntastic_javascript_checkers=['eslint'] 
let g:syntastic_html_checkers=['w3', 'eslint']

